import http from "@/api/axios";

export const getListApi = (data: WaybillQuotation.SearchParams) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/queryPage",
    data
  });
};
// 获取标签页 各状态 数量
export const getPageStaticApi = (data: WaybillQuotation.SearchParams) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/queryPageCount",
    data
  });
};
// 详情
export const getDetailsApi = (data: { id: string }) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/queryById",
    data
  });
};
// 提交报价
export const submitQuotationApi = (data: { id: string; shipmentId: string; waybillNum: string; baseUnitPrice: number; [propsName: string]: any }) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/submit",
    data
  });
};
// 撤回报价
export const revocationQuotationApi = (data: { id: string }) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/revocation",
    data
  });
};
// 运单报价日志
export const getOperationLogApi = (data: { waybillNums: string[] }) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/quotationLogList",
    data
  });
};
// 添加附加费
export const addChargeCostApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentCost/add",
    data
  });
};
// 添加附加费
export const editChargeCostApi = (data: { id: string; unitPrice: number; unit: string }) => {
  return http({
    method: "post",
    url: "/fin/biz/orderShipmentCost/edit",
    data
  });
};
// 删除附加费
export const deleteChargeCostApi = (params: { id: string }) => {
  return http({
    method: "delete",
    url: "/base/biz/orderShipmentCost/deleteById",
    params
  });
};
// 根据运单号查询附加费
export const getChargeCostByWabbillApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentCost/queryList",
    data
  });
};
// 运单报价日志
export const getLogApiByWaybillApi = (data: { waybillNums: string[] }) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/quotationLogList",
    data
  });
};

// 刷新运单单价
export const flushSettlementPriceApi = (data: { id: string }) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/flushSettlementPrice",
    data
  });
};

// 修改运单单价
export const updateUnitPriceApi = (data: { shipmentId: string; unitPrice: number }) => {
  return http({
    method: "post",
    url: "/base/biz/bizPreOrderShipment/updateUnitPrice",
    data
  });
};

// 批量导出
export const orderShipmentQuotationExcelApi = (data: WaybillQuotation.exportParams) => {
  return http({
    method: "post",
    url: "/export/biz/exportExcel/orderShipmentQuotationExcel",
    data
  });
};

//合并报关
export const combinedDeclarationApi = (data: { waybillNumList: string[]; billingWaybillNum: string }) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/combinedDeclaration",
    data
  });
};

//获取合并报关单号
export const getCombinedWaybillsApi = (params: { billingWaybillNum: string }) => {
  return http({
    method: "get",
    url: "/base/biz/orderShipmentQuotation/getCombinedWaybills",
    params
  });
};

//取消合并报关
export const cancelCombinedApi = (data: { waybillNumList: string[]; billingWaybillNum: string }) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentQuotation/cancelCombined",
    data
  });
};

//附加费列表 合并单价
export const mergeUnitPriceApi = (params: { id: string }) => {
  return http({
    method: "get",
    url: "/base/biz/orderShipmentCost/mergeUnitPrice",
    params
  });
};
